package com.hyt.it.ogt.kq.service.gov.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hyt.core.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Future;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * <p>
 * 考试任务表
 * </p>
 *
 * @author huangyh
 * @since 2021-03-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("kw_task")
@ApiModel(value="Task对象", description="考试任务表")
public class Task extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "考试任务编号")
    private String code;

    @NotBlank(message = "考试任务名称不能为空")
    @Length(max = 20, message = "考试名称长度最多支持20个字")
    @ApiModelProperty(value = "考试任务名称(前端必传)")
    private String name;

    @Future(message = "考试开始时间必须大于当前时间")
    @NotNull(message = "考试开始时间不能为空")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "考试开始时间(前端必传)")
    private LocalDateTime beginDate;

    @Future(message = "考试结束时间必须大于当前时间")
    @NotNull(message = "考试结束时间不能为空")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "考试结束时间(前端必传)")
    private LocalDateTime endDate;

    @TableField("is_publish")
    @ApiModelProperty(value = "任务发布状态，0：未发布，1：已发布")
    private Boolean publish;

    @ApiModelProperty(value = "当前月份自增序号")
    private Integer currentMonthIndex;

    @ApiModelProperty(value = "机构id")
    private String officeId;

    @ApiModelProperty(value = "部门id")
    private String deptId;

    @ApiModelProperty(value = "任务类型：1：正式考试，2：模拟考试")
    private Integer type;

    @ApiModelProperty(value = "考试形式，1：线上机考，2：线下机考")
    private String examType;

    @ApiModelProperty(value = "考试分类，多个之间用逗号分割。")
    private String testClassify;

    @ApiModelProperty(value = "报名任务ID,0 为导入")
    private String taskBmId;

    @ApiModelProperty(value = "数据锁定")
    private Boolean dataLock;

    @TableField("is_bind_platform")
    @ApiModelProperty(value = "是否绑定平台")
    private Boolean bindPlatform;
    
    @ApiModelProperty(value = "考生数量")
    private Integer candidateCount;

    @NotNull(message = "考试性质不能为空")
    @ApiModelProperty(value = "考试性质", notes = "1 -正式考试、2-仿真考试、3-模拟考试、4-补考")
    private Integer taskQualities;

    @ApiModelProperty(value = "编排方式", notes = "1-虚拟考场编排、2-实体考场编排、3-自定义编排")
    private Integer composeWay;

    @NotNull(message = "考生来源不能为空")
    @ApiModelProperty(value = "数据来源", notes = "0-无来源  1-报名绑定、2-内部导入、3-外部导入")
    private Integer dataSource;

    @ApiModelProperty("监考员编排是否锁定")
    private Boolean proctorDataLock;

    @ApiModelProperty("监考员编排方式，1-自动编排，0-手动编排，默认值0")
    private Integer proctorArrangeType;

    @ApiModelProperty("监考员编排时间")
    private LocalDateTime proctorArrangeDate;

    @ApiModelProperty("考生编排时间")
    private LocalDateTime arrangeDate;

}
